﻿using System;
using System.Windows.Forms;
using dk.Helper.Base;

namespace dk.Helper.Controls
{
    public partial class PlayerControl : UserControl
    {
        public PlayerControl(IPlayer player)
        {
            Player = player;
            InitializeComponent();
            btnPlayer.Text = player.Name;
        }

        public IPlayer Player { get; private set; }

        private void toolStripMenuItem_Click(object sender, EventArgs e)
        {
            OnRemoving(new EventArgs());
        }

        public event EventHandler Removing;

        private void OnRemoving(EventArgs e)
        {
            if (Removing != null) Removing(this, e);
        }

        private void planAttacksToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OnTargeting(new EventArgs());
        }

        public event EventHandler Targeting;

        private void OnTargeting(EventArgs e)
        {
            if (Targeting != null) Targeting(this, e);
        }
    }
}